package com.xxkfz.controller;

import com.xxkfz.service.LockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: xxkfz-admin-redisson
 * @ClassName RedissonLockController.java
 * @author: 公众号：小小开发者
 * @create: 2024-01-19 17:25
 * @description: 自定义注解实现分布式锁
 * @Version 1.0
 **/
@RestController
@RequestMapping("lock")
public class RedissonLockController {

    @Autowired
    private LockService lockService;

    /**
     * 测试自定义注解实现分布式锁
     * 测试：http://127.0.0.1:8080/lock/execBusinessData?param1=param1Value&param2=param2Value&param3=123456
     *
     * @param param1
     * @param param2
     * @param param3
     * @return
     */
    @GetMapping("execBusinessData")
    public String execBusinessData(String param1, String param2, Integer param3) {
        return lockService.execBusinessData(param1, param2, param3);
    }
}